package com.netease.spring.ch1.knight;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;

import com.netease.spring.exceptions.QuestException;

public class Main {
    public static void main(String[] args) {
        try {
            test01();
        } catch (QuestException e) {
            e.printStackTrace();
        }
    }

    public static void test01() throws QuestException {
        BeanFactory factory = new XmlBeanFactory(new FileSystemResource(
                "ch1_knight.xml"));
        Knight knight = (Knight) factory.getBean("knight");
        knight.embarkQuest();
    }
}
